import {Component, OnInit} from '@angular/core';
import {ResourceService} from '../resource.service';

@Component({
    selector: 'app-list',
    templateUrl: './list.component.html',
})
export class ListComponent implements OnInit {
    data: any[] = [];

    constructor(private resourceService: ResourceService, ) {
    }

    ngOnInit() {
        this.getList();
    }

    /**
     * 获取资源列表
     */
    getList() {
        this.resourceService.getResourceList().subscribe(res => {
            this.data = res['list'];
        });
    }

}
